<template>
  <div>
      <div class="box" v-for="(v,i) in arr" :key="i"  @click="fun(v.type)">
          <div class="box-l">
              <img :src="v.img" alt="">
              <h2>{{v.type}}</h2>
              <span>{{v.fun}}</span>
          </div>
          <div class="box-r">
              <span>共<i>{{v.num}}</i>个商品   &nbsp;></span>
          </div>
      </div>
  </div>
</template>

<script>
export default {
    data(){
        return {
            
        }
    },
    props:{
        arr:Array,
    },
    methods:{
        fun(data){
             this.$router.push({ path: '/shoplist',query:{type:data}})
        }
    }
}

</script>

<style scoped>
    .box{
        width: 3.5rem;
        height: 0.5rem;
        margin: auto;
        display: flex;
        justify-content: space-around;
        background-color:white;
        border-radius: 0.2rem;
        box-sizing: border-box;
        padding: 0 0.2rem;
        margin-bottom: 0.2rem;
    }
    .box-l{
        width: 49%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }
     .box-r{
        width: 49%;
        height: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }
    .box-l>img{
        width: 0.3rem;
        height: 0.3rem;
    }
    .box-l>h2{
        margin-left: 0.1rem;
    }
    .box-l>span{
        display: block;
        text-align: center;
        box-sizing: border-box;
        line-height: 0.14rem;
        width: 0.4rem;
        height: 0.15rem;
        margin: 0.1rem 0.1rem;
        border: 1px solid black;
    }
    .box-r{
        font-size: 0.15rem;
    }
    .box-r>span>i{
        color: #E06E2A;
    }
</style>